<?php

/**
 * Teacher form.
 *
 * @package    academia_de_escritores
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class TeacherForm extends BaseTeacherForm
{
  public function configure()
  {
    $this->widgetSchema['info'] = new sfWidgetFormTextareaTinyMCE();    
    $this->widgetSchema['photo'] = new sfWidgetFormInputFileEditable(array(
        'file_src' => $this->getObject()->getPhotoWebPath(),
        'is_image' => true,
        'template' => '<style type="text/css">.edit_image img{ width: 150px; height:100px; }</style><div class="edit_image">%file%<br />%input%<br />%delete% %delete_label%</div>',
        'edit_mode'=>$this->getObject()->getPhoto(),
        'label' => 'Foto'
    ));
    
    $this->widgetSchema['publications_list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'Publication', "renderer_class" => "sfWidgetFormSelectDoubleList"));
    $this->validatorSchema['photo'] = new sfValidatorFile(array(
      'required'   => $this->getObject()->getPhoto()?false:true,
      'path'       => sfConfig::get('sf_upload_dir'),
      'mime_types' => 'web_images',
      'max_size'   => '1000000'
    ));
  }
}
